<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    .box{width: 300px;height: 300px;background: red;}
  </style>
</head>
<body>
  <div class="box"></div>
</body>
<script>

  var box = document.querySelector(".box")

  box.onclick = function(){
    console.log("点击事件")
  }
  box.onmousemove = function(){
    console.log("鼠标移动了")
  }

  // 移动端的专属事件
  box.ontouchstart = function(){
    console.log("手指按下")
  }
  box.ontouchmove = function(){
    console.log("手指移动")
  }
  box.ontouchend = function(){
    console.log("手指抬起")
  }
  
</script>
</html>